import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import { configRouterMap } from './config'
import { errPages } from './common/errPages'

export const routes: Array<RouteRecordRaw> = [
  {
    path: '/index',
    component: () => import('@/modules/Layout/index.vue'),
    children: [
      {
        path: '/',
        redirect: '/setting-center/setting-manage/timelog' // 路由重定向
      },
      ...configRouterMap
    ]
  },

  ...errPages
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
